package cn.gok.homework;

public class SuperWorker extends Worker {
    private float bonus;


    public SuperWorker(String name, String job, int salary) {
        super(name, job, salary);
    }

    public int doJob(int months, int addtionalHours) {
        System.out.println(this.getName() + "工作了" + months + "月，获得" + (this.getSalary() * months + this.bonus * this.getSalary() * addtionalHours / 100) + "工资");
        return (int) (this.doJob(months) + this.bonus * this.getSalary() * addtionalHours / 100);
    }

    public SuperWorker(String name, String job, int salary, float bonus) {
        super(name, job, salary);
        this.bonus = bonus;
    }

    @Override
    public String toString() {
        return "SuperWorker{" +
                "bonus=" + bonus +
                '}';
    }

    public float getBonus() {
        return bonus;
    }

    public void setBonus(float bonus) {
        this.bonus = bonus;
    }
}
